r = 1 lobster = 1 butter = 1 SCREEN 12 COLOR 7, 0 CLS DIM SHARED DOOM AS DOUBLE Minutes = 10 Seconds = 0 GameTime = Minutes * 60 + Seconds DIM directions(1 TO 12) AS STRING directions(1) = "EAST" directions(2) = "EAST OR WEST" directions(3) = "NORTH" directions(4) = "NORTH OR SOUTH" directions(5) = "NORTH OR SOUTH" directions(6) = "NORTH, SOUTH, WEST" directions(7) = "NORTH OT SOUTH" directions(8) = "NORTH OR SOUTH" directions(9) = "SOUTH" PRINT "" PRINT "" PRINT "A nice Friday evening at the beach. A good place to unwind and forget all" PRINT "about your day to day life. What could possibly go wrong? But a sixty foot" PRINT "tall grab, thats mad, mad at people for eating his kind. Armed with a stick" PRINT "of butter and your wits. Can youre heart bare the terror of the thirty foot" PRINT "lobster beast??? Oh and you have five minutes until the stick of butter melts." PRINT "" PRINT "Good Luck" PRINT "" DO: LOOP UNTIL INKEY$ <> "" DOOM = TIMER(0.001) + GameTime 'change this to to desied time for the game to run DO CLS PRINT PRINT PRINT " " PRINT " " PRINT " " PRINT " The Cusp of Death " PRINT " " PRINT " Written by " PRINT " " PRINT " D.B. Taylor" PRINT "" PRINT " Copyright (c) 2015" PRINT "" PRINT SPACE$(38); IF INSTR(directions(r), "NORTH") THEN PRINT "N" ELSE PRINT PRINT "*---------------------------------* "; IF INSTR(directions(r), "WEST") THEN PRINT "W"; ELSE PRINT " "; PRINT " + "; IF INSTR(directions(r), "EAST") THEN PRINT "E"; ELSE PRINT " "; PRINT " *------------------------------------*" PRINT SPACE$(38); IF INSTR(directions(r), "SOUTH") THEN PRINT "S" ELSE PRINT PRINT PRINT "If you are stuck just type HELP." PRINT GOSUB ROOM GOSUB parser LOOP ROOM: IF r = 1 THEN: GOSUB r1 IF r = 2 THEN: GOSUB r2 IF r = 3 THEN: GOSUB r3 IF r = 4 THEN: GOSUB r4 IF r = 5 THEN: GOSUB r5 IF r = 6 THEN: GOSUB r6 IF r = 7 THEN: GOSUB r7 IF r = 8 THEN: GOSUB r8 IF r = 9 THEN: GOSUB r9 RETURN parser: PRINT "> "; cmd$ = GrabInput cmd$ = LTRIM$(RTRIM$(UCASE$(cmd$))) IF cmd$ = "END" OR cmd$ = "QUIT" OR cmd$ = "EXIT" OR cmd$ = "Q" THEN END END IF IF cmd$ = "HELP" OR cmd$ = "H" OR cmd$ = "?" THEN CLS PRINT "HERE ARE SOME BASIC COMMANDS THAT CAN BE USED IN THE GAME..." PRINT PRINT "NORTH, EAST ,SOUTH, AND WEST - MOVE TO AN AVAILABLE LOCATION" PRINT "EXAMINE (OBJECT) - EXAMINE AN OBJECT" PRINT "USE (OBJECT) - USE AN OBJECT" PRINT "TAKE (OBJECT) - TAKE OR MOVE AN OBJECT" PRINT "INVENTORY - VIEW YOUR INVENTORY" PRINT "DRINK - DRINK BEER" PRINT "UNLOCK - UNLOCK DOOR" PRINT "HELP - VIEW THIS SCREEN" PRINT "END - END GAME" PRINT PRINT "PRESS ANY KEY...": SLEEP DO: LOOP UNTIL INKEY$ = "" DO: LOOP UNTIL INKEY$ <> "" END IF IF cmd$ = "INVENTORY" OR cmd$ = "INV" OR cmd$ = "ITEMS" OR cmd$ = "I" THEN CLS PRINT "INVENTORY..." PRINT IF gotbutter = 1 THEN: PRINT "A stick of unsalted butter...yummy." PRINT PRINT "PRESS ANY KEY..." DO: LOOP UNTIL INKEY$ = "" DO: LOOP UNTIL INKEY$ <> "" END IF IF cmd$ = "GO NORTH" OR cmd$ = "NORTH" OR cmd$ = "N" THEN IF r = 3 THEN: r = 4: GOTO moved IF r = 4 THEN: r = 5: GOTO moved IF r = 5 THEN: r = 6: GOTO moved IF r = 6 THEN: r = 7: GOTO moved IF r = 7 THEN: r = 8: GOTO moved IF r = 8 THEN: r = 9: GOTO moved END IF IF cmd$ = "GO EAST" OR cmd$ = "EAST" OR cmd$ = "E" THEN IF r = 1 THEN: r = 2: GOTO moved IF r = 2 THEN: r = 3: GOTO moved END IF IF cmd$ = "GO SOUTH" OR cmd$ = "SOUTH" OR cmd$ = "S" THEN IF r = 9 THEN: r = 8: GOTO moved IF r = 8 THEN: r = 7: GOTO moved IF r = 7 THEN: r = 6: GOTO moved IF r = 6 THEN: r = 5: GOTO moved IF r = 5 THEN: r = 4: GOTO moved IF r = 4 THEN: r = 3: GOTO moved END IF IF cmd$ = "GO WEST" OR cmd$ = "WEST" OR cmd$ = "W" THEN IF r = 6 THEN: r = 2: GOTO moved IF r = 2 THEN: r = 1: GOTO moved END IF IF (cmd$ = "EXAMINE BEACH SIGN") AND r = 1 THEN CLS PRINT "It's crafted out of drift wood and hand craved." DO: LOOP UNTIL INKEY$ = "" DO: LOOP UNTIL INKEY$ <> "" END IF IF (cmd$ = "READ SIGN") AND r = 1 THEN CLS PRINT "It reads -Welcome to Sunny Cove-." DO: LOOP UNTIL INKEY$ = "" DO: LOOP UNTIL INKEY$ <> "" END IF IF (cmd$ = "TALK TO LOBSTER") AND r = 9 THEN CLS PRINT "Do you honestly think it's going to speak to you?" DO: LOOP UNTIL INKEY$ = "" DO: LOOP UNTIL INKEY$ <> "" END IF IF (cmd$ = "EXAMINE LOBSTER") AND r = 9 THEN CLS PRINT "A large shelled creature from the depths of the ocean floor." PRINT "It's mad...it's hungry...and it only see's you!" DO: LOOP UNTIL INKEY$ = "" DO: LOOP UNTIL INKEY$ <> "" END IF IF (cmd$ = "TALK TO BUTTER") AND gotbutter = 1 THEN CLS PRINT "No wonder, no one hangs out with you!" DO: LOOP UNTIL INKEY$ = "" DO: LOOP UNTIL INKEY$ <> "" END IF IF (cmd$ = "EXAMINE BUTTER") AND gotbutter = 1 THEN CLS PRINT "A fresh stick of unsalted butter. Why do you carry around a stick" PRINT "of butter?" DO: LOOP UNTIL INKEY$ = "" DO: LOOP UNTIL INKEY$ <> "" END IF IF (cmd$ = "USE BUTTER") AND gotbutter = 1 THEN CLS GOTO win: DO: LOOP UNTIL INKEY$ = "" DO: LOOP UNTIL INKEY$ <> "" END IF IF (cmd$ = "GO TO CAR") AND r = 1 THEN CLS GOTO lose: DO: LOOP UNTIL INKEY$ = "" DO: LOOP UNTIL INKEY$ <> "" END IF moved: RETURN r1: PRINT "You are standing at the entraceway of the beach. A large wooden" PRINT "signs towers beside you. The smell of the ocean makes you gag." RETURN r2: PRINT "As you walk down the wooden steps leading to sandy Earth below." PRINT "Everyone's gone...not a soul in sight." RETURN r3: PRINT "You reach the end of the small beach. A wall of rocks blocks" PRINT "the path and you aren't going to risk climbing over them." RETURN r4: PRINT "While you wander down the beach, you feel the eye's of something" PRINT "watching you...and it makes you feel uneasy." RETURN r5: PRINT "The soothing ocean waves make you feel sleepy. Damn, these relaxing" PRINT "ocean waves." RETURN r6: PRINT "You are standing on the uneven sand bed. The crash of the ocean" PRINT "waves just ten feet away from you. Not a soul in sight and not" PRINT "even a boat to be seen." RETURN RETURN r7: PRINT "A blanket of darkness covers the land before you. The only light given" PRINT "is from the orb we call the moon." RETURN r8: PRINT "You begin hearing a strange sound coming from the distance. It's" PRINT "like a clicking mixed with a hiss..." RETURN r9: PRINT "Standing before you, you see a monsterous beast, as tall as a house," PRINT "and built like a tank. It's a monsterous giant lobster, with a cold" PRINT "dead look in it's eye's. It's hungry...it's hungry for you..." RETURN win: COLOR 7, 0 CLS PRINT "You form the butter into the shape of a knife and plunge it" PRINT "into the beasts warm under belly. It's lets out a cry and" PRINT "falls to the ground...dead. Looks like you are eating good" PRINT "tonight." PRINT DO: LOOP UNTIL INKEY$ <> "" END lose: COLOR 7, 0 CLS PRINT "You head back to your car and drive away. The beach visitors" PRINT "are feasted upon by the monster lobster monster. Better safe" PRINT "than dead." PRINT DO: LOOP UNTIL INKEY$ <> "" END FUNCTION GrabInput$ x = POS(0) y = CSRLIN maxwidth = _WIDTH - x PCOPY 0, 1 'make a backup copy of the screen DO k = _KEYHIT i$ = INKEY$ LOOP UNTIL k = 0 AND INKEY$ = "" 'clear the keyboard buffer DO _LIMIT 30 PCOPY 1, 0 LOCATE y, x: PRINT Userinput$ k = _KEYHIT SELECT CASE k CASE 8 Userinput$ = LEFT$(Userinput$, LEN(Userinput$) - 1) CASE 65 TO 90, 97 TO 122, 32 Userinput$ = UCASE$(Userinput$ + CHR$(k)) END SELECT timerleft## = (DOOM - TIMER(0.001)) minutes = timerleft## \ 60 seconds = timerleft## - minutes * 60 LOCATE 2, 32: PRINT USING " ###:##.###"; minutes, seconds IF timerleft## <= 0 THEN GOTO doomed _DISPLAY LOOP UNTIL k = 13 GrabInput$ = Userinput$ _AUTODISPLAY EXIT FUNCTION doomed: CLS PRINT "All is lost...the lobster lunges at you as the butter melts" PRINT "and you are no more. The funny thing is, human tastes just" PRINT "like chicken." _DISPLAY END END SUB